import re

file = 'D://vec_test/report.json'
out1 = 'D://vec_test/docid.txt'
fout = open(out1, 'w', encoding='utf-8')

x = set()
with open(file, 'r', encoding='utf-8') as f:
    for line in f.readlines():
        if bool(re.search("docid", line)):
            x.add(line.strip().split(' ')[1][1:-2] + '\n')

for i in x:
    fout.write(i)
fout.close()
